<?php

namespace app\common\model\newhouse;

use think\Model;


class Tags extends Model
{

    

    

    // 表名
    protected $name = 'newhouse_tags';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'column_list_text',
        'statusswitch_text'
    ];
    

    
    public function getColumnListList()
    {
        return ['0' => __('Column_list 0'), '1' => __('Column_list 1'), '2' => __('Column_list 2')];
    }

    public function getStatusswitchList()
    {
        return ['0' => __('Statusswitch 0'), '1' => __('Statusswitch 1')];
    }


    public function getColumnListTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['column_list']) ? $data['column_list'] : '');
        $list = $this->getColumnListList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getStatusswitchTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['statusswitch']) ? $data['statusswitch'] : '');
        $list = $this->getStatusswitchList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
